<%@ page import="controllers.SolutionConnect" %>
<%@ page import="controllers.AdoptionConnect" %>
<%@ page import="models.SolutionSubmission" %>
<%@ page import="models.SolutionAdoption" %>
<%@ page import="java.util.List,java.text.*"%>
<%@ page import="java.util.List, java.util.HashMap" %>
<%@ page import="com.googlecode.objectify.Objectify, com.googlecode.objectify.ObjectifyService, com.googlecode.objectify.Query" %>

<!-- content -->
<!--<a id="mainContent" name="mainContent"/>-->
<div id="lotusContent">
<div class="lotusLayout lotusHeader">
<!--<h1>Savvy Solutions</h1>
<div class="lotusDetails">The Global Operations Excellence collection of Savvy Solutions resulting in cost savings for the company</div>-->
</div>
<!-- View selector -->
<div class="lotusActionBar lotusBtnContainer">
<!-- Buttons -->
<%
String useremail = (String) pageContext.getAttribute("USER_EMAILID", PageContext.PAGE_SCOPE);
        

%>

<b>Savvy Solutions for :</b>
<!--<span class="lotusBtn lotusBtnAction lotusLeft">
<a href="/blogs/roller-ui/myblogs/newentry">New Entry</a>
</span>-->
</div>

<% 
/*
SolutionConnect SOL = new SolutionConnect();
AdoptionConnect ADP = new AdoptionConnect();
        
List<HashMap<String,Object>> rs = SOL.getQuery("Status","Draft");
List<HashMap<String,Object>> rs1 = SOL.getQuery("Status","Shared");

List<HashMap<String,Object>> adprs = ADP.getQuery("submittedBY",useremail);

//if ( !SOL.hasEntries() )
//  response.sendRedirect("/modules/default/error.jsp?error_msg=Error in displaying the solution.");
*/

Objectify ofy = ObjectifyService.begin();
Query<SolutionSubmission> rs = ofy.query(SolutionSubmission.class).filter("Status","Draft").filter("submittedBY",useremail);
Query<SolutionSubmission> rs1 = ofy.query(SolutionSubmission.class).filter("Status","Shared").filter("submittedBY",useremail);
Query<SolutionAdoption> adprs = ofy.query(SolutionAdoption.class).filter("submittedBY",useremail);


%>
        <link href="/media/dataTables/demo_page.css" rel="stylesheet" type="text/css" />
        <link href="/media/dataTables/demo_table.css" rel="stylesheet" type="text/css" />
        <link href="/media/dataTables/demo_table_jui.css" rel="stylesheet" type="text/css" />
        <link href="/media/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" media="all" />
        <link href="/media/themes/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="all" />
        <script src="/scripts/jquery.js" type="text/javascript"></script>
        <script src="/scripts/jquery.dataTables.min.js" type="text/javascript"></script>
        <script type="text/javascript">
        $(document).ready(function () {
            $("#draft").dataTable({
                "sPaginationType": "full_numbers",
                "bJQueryUI": true
            });
            
            $("#submitted").dataTable({
                "sPaginationType": "full_numbers",
                "bJQueryUI": true
            });           
            
            $("#adoption").dataTable({
                "sPaginationType": "full_numbers",
                "bJQueryUI": true
            });           
            
        });
        </script>

<h2>Draft Solutions :</h2>
<div id="dt_example">
    <div id="container">
        <div id="demo_jui">
      <table id="draft" class="display">
          <thead>
              <tr>
                  <th>Solution ID</th>
                  <th>Solution Title</th>
                  <th>Process</th>
                  <th>Primary Benefit</th>
              </tr>
          </thead>
          <tbody>
                <% for ( SolutionSubmission f : rs.fetch() ) { %>
          <tr>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getSolCode()%></a></td>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getTitle()%></a></td>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getProcessArea()%></a></td>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getAchievedTypeDesc()%></a></td>
          </tr>
        <% } %>
          </tbody>
      </table>
      </div>
    </div>
</div>

<h2>Submitted Solutions :</h2>
<div id="dt_example">
    <div id="container">
        <div id="demo_jui">
      <table id="submitted" class="display">
          <thead>
              <tr>
                  <th>Solution ID</th>
                  <th>Solution Title</th>
                  <th>Process</th>
                  <th>Primary Benefit</th>
              </tr>
          </thead>
          <tbody>
                <% for ( SolutionSubmission f : rs1.fetch() ) { %>
          <tr>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getSolCode()%></a></td>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getTitle()%></a></td>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getProcessArea()%></a></td>
            <td><a href="/modules/default/display-solution.jsp?sol_id=<%=f.getSolID()%>"><%=f.getAchievedTypeDesc()%></a></td>
          </tr>
        <% } %>
          </tbody>
      </table>
      </div>
    </div>
</div>


<h2>Adopted Solutions :</h2>
<div id="dt_example">
    <div id="container">
        <div id="demo_jui">
      <table id="adoption" class="display">
          <thead>
              <tr>
                  <th>Solution ID</th>
                  <th>Solution Title</th>
                  <th>Process</th>
                  <th>Primary Benefit</th>
                  <th>Location</th>
              </tr>
          </thead>
          <tbody>
                <% for ( SolutionAdoption f : adprs.fetch() ) { %>
          <tr>
            <td><a href="/modules/default/display-adoption.jsp?adopt_id=<%=f.getAdoptID()%>"><%=f.getSolCode()%></a></td>
            <td><a href="/modules/default/display-adoption.jsp?adopt_id=<%=f.getAdoptID()%>"><%=f.getSolTitle()%></a></td>
            <td><a href="/modules/default/display-adoption.jsp?adopt_id=<%=f.getAdoptID()%>"><%=f.getProcessArea()%></a></td>
            <td><a href="/modules/default/display-adoption.jsp?adopt_id=<%=f.getAdoptID()%>"><%=f.getAchievedTypeDesc()%></a></td>
            <td><a href="/modules/default/display-adoption.jsp?adopt_id=<%=f.getAdoptID()%>"><%=f.getLocation()%></a></td>
          </tr>
        <% } %>
          </tbody>
      </table>
      </div>
    </div>
</div>


<!--End of Lotus Content-->
</div>
<!--End of Lotus Main-->
</div>
<!-- Footer gets moved to within Frame div in weblog.vm so closing tags need to go in weblog.vm - MTodd November 1 2007 </body> </html> -->
</div>
</div>
<input name="Remote_User" type="hidden" value="CN=Wai Tat See/OU=SG/OU=Asia/O=Celestica">
<input name="SaveOptions" type="hidden" value="0">
<input name="HTTP_Cookie" type="hidden" value="redirectto=/global/collaboration/SavvySol.nsf/frmsavvy%3FOpenForm%26login; LtpaToken=ZDKFFoPfuAGbPyVskMUDPgxWENdj6diTwzdqpeE75D7FBQstuBp54bmVG+1NUJgipQeljrUEAnGe8B8Hy4xO6Ip1B52UiBE2D38M/XtiBuuR1VTHf9sxTVPakjCO9kRh+u37exCde0HW4anckpDjCjBca3xmtNzAztKf7ZrCju09loEt1Bbj4tXt3D3Jwfgtr7mnXY7p99bsDfsdzGSxIGE0B5FexyBHR/02R0sCOp7AvkieyyEV4PETctlJwZT8Ll6bckcIDlUK80b0FuGcQHsOp/aCxwhm6H6EjZNBuiuuBsLGX6COlAyNIofKNnjmdvfdhh6/RrWFw9ttyxMbKs33t1bWwTIdLBpGwcEg748=">
<input name="Query_String_Decoded" type="hidden" value="OpenForm&amp;login">
<input name="Query_String" type="hidden" value="OpenForm&amp;login">
<input name="dbName" type="hidden" value="global/collaboration/SavvySol.nsf">
<input name="Position" type="hidden" value="">
<input name="curUsername" type="hidden" value="CN=Wai Tat See/OU=SG/OU=Asia/O=Celestica">
<input name="QuickSearch" type="hidden" value="0">
<input name="UserProfileInfo" type="hidden" value="">
<input name="txtProfileUNID" type="hidden" value="">